package threadcoreknowledge.threadobjectclasscommonmethods;

import org.junit.Test;

public
class

WaitInSyncBlockTest {

    @Test
    public void test() {
        try {
            new Object().wait();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }

    private Object obj = new Object();
    private Object anotherObj = new Object();
    @Test
    public void test3() {
        synchronized (obj) {
            try {
                anotherObj.notify();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
